From: Jonas Dreßler Date: Thu, 21 Nov 2019 12:05:11 +0000 (+0700) Subject: st/icon: Check icon name for empty string in setter function X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~781^2^2~214 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=8b15519160360ac24b55f2a1f06bdd069b81b375;p=gnome-shell.git st/icon: Check icon name for empty string in setter function Don't try to create a GIcon if the given icon name is empty, it will lead to failure when loading the icon anyway, instead set the gicon to NULL just as we do in the `set_gicon()` API when unsetting an icon. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/888 --- diff --git a/src/st/st-icon.c b/src/st/st-icon.c index 8b8dbc2ff..aa98ed223 100644 --- a/src/st/st-icon.c +++ b/src/st/st-icon.c @@ -553,7 +553,7 @@ st_icon_set_icon_name (StIcon *icon, g_return_if_fail (ST_IS_ICON (icon)); - if (icon_name) + if (icon_name && *icon_name) gicon = g_themed_icon_new_with_default_fallbacks (icon_name); g_object_freeze_notify (G_OBJECT (icon)); @@ -730,7 +730,7 @@ st_icon_set_fallback_icon_name (StIcon *icon, g_return_if_fail (ST_IS_ICON (icon)); - if (fallback_icon_name != NULL) + if (fallback_icon_name && *fallback_icon_name) gicon = g_themed_icon_new_with_default_fallbacks (fallback_icon_name); g_object_freeze_notify (G_OBJECT (icon));